﻿using System;
using System.ServiceModel;
using System.ServiceModel.Description;

namespace FakeSmsServiceHost
{
    class Program
    {
        static void Main(string[] args)
        {
            using (ServiceHost host = new ServiceHost(typeof(FakeSmsService.SmsService)))
            {
                //host.AddServiceEndpoint(typeof(FakeSmsService.ISmsService), new BasicHttpBinding(), "http://localhost:9999/fakesmsservice");
                //if (host.Description.Behaviors.Find<ServiceMetadataBehavior>() == null)
                //{
                //    ServiceMetadataBehavior behavior = new ServiceMetadataBehavior();
                //    behavior.HttpGetEnabled = true;
                //    behavior.HttpGetUrl = new Uri("http://localhost:9999/fakesmsservice/metadata");
                //    host.Description.Behaviors.Add(behavior);
                //}
                host.Opened += delegate
                {
                    Console.WriteLine("FakeSmsService is start. Press any key to stop.");
                };

                host.Open();
                Console.Read();
            }
        }
    }
}
